﻿/*-----------------------------------------------
// File: ShowCampRunState.cs
// Description: 
// Author: Shaobing	492057342@qq.com
-----------------------------------------------*/
using UnityEngine;
using System.Collections;

namespace Battle.View
{
    public class ShowCampRunState : Fsm.FsmStateBase<BattleRoundState>
    {
        BattleRoundCtrl battleRoundCtrl = null;
        public ShowCampRunState(BattleRoundState state, BattleRoundCtrl ctrl) : base(state, ctrl)
        {
            battleRoundCtrl = ctrl;
        }

        float deltaTime = 0f;
        public float showCampTime {
            get { return Dict.Blo.DictConfigBlo.GetShowCampTime(); }
        }
        public override void Enter()
        {
            BattleManager.Instance.battlePanel.ShowRoundEffect((int)battleRoundCtrl.currentCamp);
            deltaTime = 0f;
        }

        public override void Update()
        {
            deltaTime += Time.deltaTime;
            if (deltaTime >= showCampTime)
            {
                battleRoundCtrl.SwitchState(BattleRoundState.RoundEnterState);
            }
        }

        public override void Leave()
        {
            //battleRoundCtrl.runningState.CheckRoundBeginRespects();
        }
    }
}
